<!-- ASF Widget tag library documentation
  -  Copyright (C) 2013 Stephane Carrez
  -  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
  -
  -  Licensed under the Apache License, Version 2.0 (the "License");
  -  you may not use this file except in compliance with the License.
  -  You may obtain a copy of the License at
  -
  -      http://www.apache.org/licenses/LICENSE-2.0
  -
  -  Unless required by applicable law or agreed to in writing, software
  -  distributed under the License is distributed on an "AS IS" BASIS,
  -  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  -  See the License for the specific language governing permissions and
  -  limitations under the License.
  -->
<c:choose xmlns:c="http://java.sun.com/jstl/core"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:util="http://code.google.com/p/ada-asf/util">
    <!-- For security reasons, check that the code parameter matches what is allowed  -->

    <c:when test="#{empty param['code'] or param['code'] eq 'accordion'}">
        <util:script>
            Sample_Highlight('accordion', 'w:accordion');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-accordion linenums:1"><util:file src="/widgets/accordion.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'autocomplete'}">
        <util:script>
            Sample_Highlight('autocomplete', 'w:autocomplete');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-autocomplete linenums:1"><util:file src="/widgets/autocomplete.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'inputText'}">
        <util:script>
            Sample_Highlight('inputText', 'w:inputText');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-inputText linenums:1"><util:file src="/widgets/inputText.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'inputDate'}">
        <util:script>
            Sample_Highlight('inputDate', 'w:inputDate');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-inputDate linenums:1"><util:file src="/widgets/inputDate.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'gravatar'}">
        <util:script>
            Sample_Highlight('gravatar', 'w:gravatar');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-gravatar linenums:1"><util:file src="/widgets/gravatar.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'like'}">
        <util:script>
            Sample_Highlight('like', 'w:like');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-like linenums:1"><util:file src="/widgets/like.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'panel'}">
        <util:script>
            Sample_Highlight('panel', 'w:panel');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-panel linenums:1"><util:file src="/widgets/panel.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'tab'}">
        <util:script>
            Sample_Highlight('tab', 'w:tab');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-tab linenums:1"><util:file src="/widgets/tab.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:when test="#{param['code'] eq 'tabView'}">
        <util:script>
            Sample_Highlight('tabView', 'w:tabView');
            prettyPrint();
        </util:script>
        <code class="prettyprint lang-tabView linenums:1"><util:file src="/widgets/tabView.xhtml" escape="true"/>
        </code>
    </c:when>

    <c:otherwise>
        <p>
            <h:outputFormat value="You have not selected the valid code: '{0}' is not recognized.">
                <f:param value="#{param['code']}"/>
            </h:outputFormat>
        </p>
    </c:otherwise>
</c:choose>